package com.zhike.b2b.help;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.zhike.b2b.model.MenuVo;
import com.zhike.b2b.role.IRoleService;

@Controller
public class HelpAction {

	 @Resource
	 private IRoleService rs;
	 @RequestMapping("/admin/helponline.do")
	 public ModelAndView getAdminNavi(@RequestParam("menuId") String menuId)
	 {
		 ModelAndView mav = new ModelAndView("/include/help/helponline");
		 MenuVo mv = rs.getMenuBySubIdSix(menuId);
		 String menuIdSix = menuId.substring(0,6);
		 String menuIdThree = menuId.substring(0,3);
		 MenuVo smv = rs.getMenuBySubIdSix(menuIdSix);
		 MenuVo tmv = rs.getMenuBySubIdSix(menuIdThree);
		 String menuName = "";
		 if(mv.getMenuId().length()>6)
			 menuName = "-"+mv.getMenuName();
		 mav.addObject("menuId", menuId);
		 mav.addObject("naviPath", "-"+tmv.getMenuName()+"-"+smv.getMenuName()+menuName);
		 return mav;
	 }
}
